import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { BrowserRouter, Route } from 'react-router-dom';
import { ResetStyle } from './style';
import { IconfontStyle } from './statics/iconfont/iconfont';
import Header from './common/header/index';
import Home from './pages/home';
import Detail from './pages/detail/loadable.js';
import Login from './pages/login';
import Write from './pages/write';
import store from './store/index';


class App extends Component {
    render() {
        return (
            <Provider store={store}>
                <ResetStyle />
                <IconfontStyle />
                    <BrowserRouter>
                        <div>
                <Header />
                            <Route path='/' exact component={Home}></Route>
                            <Route path='/login' exact component={Login}></Route>
                            <Route path='/write' exact component={Write}></Route>
                            <Route path='/detail/:id' exact component={Detail}></Route>
                        </div>
                    </BrowserRouter>
            </Provider>
        );
    }
}

export default App;
